<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">

<body>
<form enctype="multipart/form-data">
    <div class="form-group">
        <input id="file-1" type="file" multiple="multiple" class="file" data-overwrite-initial="false" data-min-file-count="1" />
    </div>
</form>
<script th:inline="javascript">
    $("#file-1").fileinput({
        uploadUrl: 'uploadFile', // you must set a valid URL here else you will get an error
        allowedFileExtensions: ['jpg', 'png', 'gif'],
        overwriteInitial: false,
        maxFileSize: 1000,
        maxFilesNum: 10,
        language: 'zh',
        //allowedFileTypes: ['image', 'video', 'flash'],
        slugCallback: function (filename) {
            return filename.replace('(', '_').replace(']', '_');
        }
    });

    $("#file-1").on("fileuploaded", function (event, data, previewId, index) {
        alert('数据上传成功')
    });
</script>
</body>
</html>